<template>
  <div class="content">
    <div class="title">
      热门精选
    </div>
    <div class="item">
      <template v-for="(item, i) in homer.homelist" :key="item.data.houseId">
        <HomeNine v-if="item.discoveryContentType == 9" :itemDate="item.data" @click="goDetail(item.data)"></HomeNine>
        <HomeThree v-else-if="item.discoveryContentType == 3" :itemDate="item.data" @click="goDetail(item.data)">
        </HomeThree>
      </template>
    </div>
  </div>
<!-- <button @click="addPage">点击</button> --></template>
<script setup>
import { useRouter } from 'vue-router';
import { useHome } from '../../../Pinia/modules/home';
import HomeNine from '../../../components/content/homeNine.vue';
import HomeThree from '../../../components/content/homeThree.vue';
const homer = useHome();
// function addPage() {
//   homer.getHomeList()
// }
const router = useRouter()
const goDetail = (item) => {
  router.push({
    path: '/detail',
    query: {
      houseId: item.houseId
    }
  })
}
</script>
<style lang="less" scoped>
.content {
  padding: 10px 8px;

  .title {
    font-size: 22px;
    padding: 10px;
    font-weight: bold;
  }

  .item {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
</style>